import { BelongsTo, Column, Comment, ForeignKey, Model, Table } from 'sequelize-typescript';
import { User } from './user.model';

@Table
export class Photo extends Model<Photo> {
  @Comment('文件名')
  @Column({ allowNull: false })
  flieName: string;

  @Comment('文件地址')
  @Column({ allowNull: false })
  url: string;

  @ForeignKey(() => User)
  @Column({ allowNull: false })
  userId: number;

  @BelongsTo(() => User)
  user: User;
}
